package com.example.design.decorator.cake;

/**
 * @Description 装饰者模式测试类，煎饼果子加蛋加香肠
 * @ClassName DecoratorTest
 * @Author Administrator
 * @Date 2020/5/13 16:14
 * @Version 1.0.0
 */
public class DecoratorTest {

    public static void main(String[] args) {

        AbstractCake abstractCake = new BatterCake();
        System.out.println(abstractCake.getDesc() + ", 销售价格:" + abstractCake.cost());

        abstractCake = new EggDecorator(abstractCake);
        System.out.println(abstractCake.getDesc() + ", 销售价格:" + abstractCake.cost());

        abstractCake = new EggDecorator(abstractCake);
        System.out.println(abstractCake.getDesc() + ", 销售价格:" + abstractCake.cost());

        abstractCake = new SausageDecorator(abstractCake);
        System.out.println(abstractCake.getDesc() + ", 销售价格:" + abstractCake.cost());
    }
}
